import streamlit as st
from streamlit_option_menu import option_menu
from web_page.chat_bot_page import chat_bot_page
from web_page.about_page import about_page
from web_page.analyse_page import analyse_page
from data_analysis.diabetes import load_model, scaler, predict


st.set_page_config(
    page_title="Coze Bot",
    page_icon="",
    layout="wide",
    menu_items={
        'About':f"""欢迎使用~"""
    }
)

pages = {
    "Coze AI Bot":{
        "icon":"🤖",
        "func":chat_bot_page,
    },
    "相关程度分析":{
        "icon":"💪",
        "func":analyse_page,
    },
    "关于我们":{
        "icon":"👀",
        "func":about_page,
    }

}

def main():
    with st.sidebar:
        st.image("ui_images/XXX.jpg",width=170)
        selected_page = option_menu(
            menu_title="功能选择",
            options = list(pages),
            icons=[pages[x]["icon"] for x in pages],
            default_index=0,
            orientation="vertical",
            styles={
                "container":{"padding":"5px 5px"},
                "icon":{"color":"#fff","font-size":"25px"},
                "nav-link":{"font-size":"16px","text-align":"left","margin":"0px","--hover-color":"#e5b75e"},
                "nav-link-selected":{"background-color":"#ffbd45"},
            }
        )

    if selected_page in pages.keys():
        pages[selected_page]["func"]()

if __name__== '__main__':
    main()